//
//  YSY_Game_DocTableViewCell.m
//  GoodManNews
//
//  Created by dllo on 16/1/12.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "YSY_Game_DocTableViewCell.h"
#import "Masonry.h"
@implementation YSY_Game_DocTableViewCell
- (void)dealloc
{
    [_mainImageV release];
    [_titleL release];
    [_dateL release];
    [super dealloc];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView {
    self.titleL = [UILabel new];
//    self.titleL.backgroundColor = [UIColor grayColor];
    self.titleL.font = [UIFont systemFontOfSize:15];
    self.titleL.numberOfLines = 0;
    [self.contentView addSubview:self.titleL];
    
    
    self.mainImageV = [UIImageView new];
//    self.mainImageV.backgroundColor = [UIColor greenColor];
    [self.contentView addSubview:self.mainImageV];
    
    self.dateL = [UILabel new];
//    self.dateL.backgroundColor = [UIColor redColor];
    self.dateL.font = [UIFont systemFontOfSize:13];
    [self.contentView addSubview:self.dateL];
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    [self.mainImageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).with.offset(10);
        make.top.equalTo(self.contentView).with.offset(10);
        make.bottom.equalTo(self.contentView).with.offset(-10);
        make.width.equalTo(@120);
    }];
    
    [self.titleL mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).with.offset(10);
        make.left.equalTo(self.mainImageV.mas_right).with.offset(10);
        make.width.equalTo(@230);
        make.height.equalTo(@40);
        
    }];
    
    [self.dateL mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.titleL.mas_bottom).with.offset(20);
        make.bottom.equalTo(self.contentView).with.offset(-10);
        make.left.equalTo(self.mainImageV.mas_right).with.offset(10);
        make.width.equalTo(@200);
        
        
    }];
}
@end
